package com.fanix5.javamvvm.app;

import android.app.Application;

import com.blankj.utilcode.util.Utils;
import com.fanix5.javamvvm.callback.EmptyCallback;
import com.fanix5.javamvvm.callback.ErrorCallback;
import com.fanix5.javamvvm.callback.LoadingCallback;
import com.kingja.loadsir.callback.SuccessCallback;
import com.kingja.loadsir.core.LoadSir;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //工具
        Utils.init(this);
        Logger.addLogAdapter(new AndroidLogAdapter());
        //loadSir
        LoadSir.beginBuilder()
                .addCallback(new LoadingCallback()) //加载
                .addCallback(new ErrorCallback()) //错误
                .addCallback(new EmptyCallback()) //空
                .setDefaultCallback(SuccessCallback.class) //设置默认加载状态界面
                .commit();
    }


}
